#The length of a string
len("llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch")


#Concatenating strings
"New" + "found" + "land"

s = "New"
s += "found"
s += "land"
s


#Joining strings
colors  =  ';'.join(['#45ff23',  '#2321fa',  '#1298a3',  '#a32312'])
colors

''.join(['high',  'way',  'man'])


#Splitting strings
colors.split(';')

'eggsandbaconandspam'.split('and')

Partitioning strings
"unforgettable".partition('forget')

departure,  separator,  arrival  = "London:Edinburgh".partition(':')
departure
arrival

origin,  _,  destination  =  "Seattle-Boston".partition('-')
origin
destination


#String formatting
"The  age  of  {0}  is  {1}".format('Jim',  32)

"The  age  of  {0}  is  {1}.  {0}'s  birthday  is  on  {2}".format('Fred',  24,  'October  31')

"Reticulating  spline  {}  of  {}.".format(4,  23) 

"Current  position  {latitude}  {longitude}".format(latitude="60N",  longitude="5E")

"Galactic  position  x={pos[0]},  y={pos[1]},  z={pos[2]}".format(pos=(65.2,  23.1,  82.2)) 

import math
"Math  constants:  pi={m.pi},  e={m.e}".format(m=math) 
"Math  constants:  pi={m.pi:.3f},  e={m.e:.3f}".format(m=math) 

@Other string methods
help(str)
